home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / buildDisplayMenu.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  43.7 KB  |  1,445 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  1 April 1996
  22. //
  23. //  Author:         jb
  24. //
  25. //  Description:
  26. //      This implements the "Display" menu on the main menubar.
  27. //
  28. {
  29.  
  30. }
  31.  
  32. // helper procs. these are approxomately in the same order the items are in the Display menu
  33.  
  34. global proc gridMenuUpdate() {
  35. //
  36. // This is called when a "gridDisplayChanged" event is detected.
  37. // Update the menu item, the option var and the gShowGrid variable.
  38. //
  39.     if( `menuItem -exists dispGridItem` ) {
  40.         menuItem -e -cb `grid -q -tgl` dispGridItem;
  41.     }
  42. }
  43.  
  44. global proc originAxesMenuUpdate() {
  45. //
  46. // This is called when a "originAxesDisplayChanged" event is detected.
  47. // Update the menu item, the option var and the gToggleOriginAxis variable.
  48. //
  49.     if( `menuItem -exists originAxesItem` ) {
  50.         menuItem -e -cb `toggleAxis -q -o` originAxesItem;
  51.     }
  52. }
  53.  
  54. global proc showLastHidden () 
  55. {
  56.     global string $gLastHiddenSelection[];
  57.     if (size($gLastHiddenSelection) != 0) {
  58.         string $cmd="showHidden -a";
  59.         for ($i in $gLastHiddenSelection) {
  60.             // must be silent if the objects don't exist anymore...
  61.             if (`objExists $i`)
  62.                 $cmd=($cmd + " " + $i);
  63.         }
  64.         evalEcho $cmd;
  65.         clear $gLastHiddenSelection;
  66.     } else warning "No previously hidden objects to show again.";
  67. }
  68.  
  69. global proc hideShowDeformingGeom( string $state )
  70. //
  71. //    Hides or shows deforming geometry in the system.
  72. //    Takes a state, either hide or show, in order to
  73. //    perform the appropriate action.
  74. {
  75.     //    Get a list of all deformers in the system, then
  76.     //    hide their associated set
  77.     //
  78.     string $deformers[] = `ls -type cluster -type jointCluster
  79.         -type jointLattice -type boneLattice -type ffd -type jointFfd
  80.         -type wire -type sculpt -type blendShape
  81.         -type geometryFilter -type weightGeometryFilter`;
  82.     string $sortedDeformers[] = `sort $deformers`;
  83.     string $lastDeformer = "";
  84.     string $deformerSets[];
  85.     string $result[];
  86.     for( $deformer in $sortedDeformers ) {
  87.         if ( $deformer != $lastDeformer )
  88.         {
  89.             $lastDeformer = $deformer;
  90.             $deformerSets = `listConnections ( $deformer + ".message" )`;
  91.             for( $set in $deformerSets ) {
  92.                 if ("objectSet" == nodeType($set))
  93.                     $result[size($result)]=$set;
  94.             }
  95.         }
  96.     }
  97.  
  98.     // $result holds a list of sets. We want the members of the sets
  99.     // so that we can get the parents
  100.     int $count = 0;
  101.     string $geometry[];
  102.     string $members[];
  103.     for( $set in $result ) {
  104.         $members = `sets -q $set`;
  105.         for( $member in $members ) {
  106.             $geometry[ $count ] = $member;
  107.             $count++;
  108.         }
  109.     }
  110.  
  111.     // get the parents (which may be shapes) of the geometry/components
  112.     string $parents[] = `listRelatives -p $geometry`;
  113.  
  114.     // Get the parent transforms of the shapes
  115.     string $shapes[] = `ls -type shape $parents`;
  116.     string $parentTransforms[] = `listRelatives -p $shapes`;
  117.  
  118.     // extract the transforms and add then to the list of shapeTransforms
  119.     string $transforms[] = `ls -type transform $parents`;
  120.     if ( size($transforms) != 0 ) {
  121.         int $count = size($parentTransforms);
  122.         for( $xform in $transforms ) {
  123.             $parentTransforms[ $count ] = $xform;
  124.             $count++;
  125.         }
  126.     }
  127.  
  128.     if( $state == "hide" ) {
  129.         if ( size($parentTransforms) != 0 ) {
  130.             hideKeepSelection $parentTransforms;
  131.         }
  132.         else warning "No deforming geometry to hide.";
  133.     }
  134.     else {
  135.         if ( size($parentTransforms) != 0 ) {
  136.             string $cmd="showHidden";
  137.             for ($i in $parentTransforms) {
  138.                 if (`objExists $i`)
  139.                     $cmd=($cmd + " " + $i);
  140.             }
  141.             evalEcho $cmd;
  142.         }
  143.         else warning "No deforming geometry to show.";
  144.     }
  145. }
  146.  
  147. proc string[] listWireCurves()
  148. //
  149. // Returns a list of all the curves attached to wire nodes
  150. // in the scene
  151. {
  152.     string $wires[];
  153.     $wires = `ls -type wire`;
  154.  
  155.     string $connections[];
  156.     string $ws[];
  157.     int $wcount = 0;
  158.     for ( $wire in $wires )
  159.     {
  160.         $connections = `listConnections ($wire + ".deformedWire")`;
  161.         int $numConn = size($connections);
  162.         for ($ii=0; $ii<$numConn; $ii++)
  163.             $ws[$wcount++] = $connections[$ii];
  164.     }
  165.     return $ws;
  166. }
  167.  
  168.  
  169. proc string[] listWrapInfluences()
  170. //
  171. // Returns a list of all the influence objects
  172. // attached to the wrap nodes in the scene
  173. {
  174.     string $wraps[];
  175.     $wraps = `ls -type wrap`;
  176.  
  177.     string $connections[];
  178.     string $infls[];
  179.     int $inflCount = 0;
  180.     for( $wrap in $wraps )
  181.     {
  182.         $connections = `listConnections ($wrap + ".driverPoints")`;
  183.         int $numConn = size($connections);
  184.         for($i=0;$i<$numConn;$i+=2)
  185.             $infls[$inflCount++] = $connections[$i];
  186.     }
  187.     return $infls;
  188. }
  189.  
  190. proc string[] listSkinClusterInfluences()
  191. //
  192. // Returns a list of all the influence objects
  193. // attached to the skinCluster nodes in the scene
  194. {
  195.     string $skinClusters[];
  196.     $skinClusters = `ls -type skinCluster`;
  197.  
  198.     string $connections[];
  199.     string $infls[];
  200.     int $inflCount = 0;
  201.     for( $skinCluster in $skinClusters )
  202.     {
  203.         $connections = `listConnections ($skinCluster + ".matrix")`;
  204.         int $numConn = size($connections);
  205.         for($i=0;$i<$numConn;$i++)
  206.         {
  207.             $transformType = `nodeType $connections[$i]`;
  208.             if ($transformType != "joint")
  209.                 $infls[$inflCount++] = $connections[$i];
  210.         }
  211.     }
  212.     return $infls;
  213. }
  214.  
  215. proc appendToList( string $list1[], string $list2[])
  216. //
  217. // Appends the elements of list2 to the end of list1
  218. {
  219.     $count = size($list1);
  220.     for( $elem in $list2 )
  221.     {
  222.         $list1[$count++] = $elem;
  223.     }
  224. }
  225.  
  226.     
  227. global proc hideShow( string $type, string $state )
  228. //
  229. // Hides/shows objects in the scene.  Takes an object
  230. // type and the state to set as arguments.  
  231. {
  232.     string $list[];
  233.  
  234.     switch( $type ) {
  235.         case "-cameras":
  236.             $list = `listTransforms "-ap -cameras"`;
  237.             break;
  238.         case "-geometry":
  239.             //
  240.             // High level setting to turn off all
  241.             // geometry types
  242.             //
  243.           if (`isTrue "SubdivUIExists"`) 
  244.             $list = `listTransforms
  245.                 "-type nurbsSurface -type nurbsCurve -type mesh -type subdiv"`;
  246.           else
  247.             $list = `listTransforms
  248.                 "-type nurbsSurface -type nurbsCurve -type mesh"`;
  249.             break;
  250.         case "-nurbsSurfaces":
  251.             $list = `listTransforms "-type nurbsSurface"`; 
  252.             break;
  253.         case "-nurbsCurves":
  254.             $list = `listTransforms "-type nurbsCurve"`;
  255.             break;
  256.         case "-polySurfaces":
  257.             $list = `listTransforms "-type mesh"`;
  258.             break;
  259.         case "-subdiv":
  260.             $list = `listTransforms "-type subdiv"`;
  261.             break;
  262.         case "-planes":
  263.             $list = `listTransforms "-type sketchPlane"`;
  264.             break;
  265.         case "-lights":
  266.             $list = `listTransforms "-type light"`;
  267.             break;
  268.         case "-strokes":
  269.             $list = `listTransforms "-type stroke"`;
  270.             break;
  271.         case "-strokeCurves":
  272.             $list = listAllStrokeCurves(false);
  273.             break;
  274.         case "-strokeControlCurves":
  275.             $list = listAllStrokeCurves(true);
  276.             break;
  277.         case "-place3dTexture":
  278.             $list = `ls -type "place3dTexture"`;
  279.             break;
  280.         case "-kinematics":
  281.         //
  282.         // High level setting to turn off
  283.         // all kinematics types
  284.         //
  285.             $list =
  286.                 `ls -type joint
  287.                     -type ikHandle`;
  288.             break;
  289.         case "-joints":
  290.             $list = `ls -type joint`;
  291.             break;
  292.         case "-ikHandles":
  293.             $list = `ls -type ikHandle`;
  294.             break;
  295.         case "-ikEff":
  296.             $list = `ls -type ikEffector`;
  297.             break;
  298.         case "-deformers":
  299.         //
  300.         // High level setting to turn
  301.         // off all deformer types
  302.         //
  303.             $list = `listTransforms
  304.                     "-type lattice -type implicitSphere -type clusterHandle -type deformBend -type deformFlare -type deformSine -type deformSquash -type deformTwist -type deformWave"`;
  305.             $wraps = listWrapInfluences();
  306.             $wires = listWireCurves();            
  307.             $skinClusters = listSkinClusterInfluences();
  308.             appendToList($list, $wraps);
  309.             appendToList($list, $wires);            
  310.             appendToList($list, $skinClusters);
  311.  
  312.             break;
  313.         case "-lattices":
  314.             $list = `listTransforms "-type lattice"`;
  315.             break;
  316.         case "-sculptObjects":
  317.             $list = `listTransforms "-type implicitSphere"`;
  318.             break;
  319.         case "-clusters":
  320.             $list = `listTransforms "-type clusterHandle"`;
  321.             break;
  322.         case "-nonlinears":
  323.             $list = `listTransforms "-type deformBend -type deformFlare -type deformSine -type deformSquash -type deformTwist -type deformWave"`;
  324.             break;
  325.         case "-wraps":
  326.             $list = listWrapInfluences();
  327.             break;
  328.         case "-skinClusters":
  329.             $list = listSkinClusterInfluences();
  330.             break;
  331.         case "-posMarker":
  332.             $list = `listTransforms "-type positionMarker"`;
  333.             break;
  334.         case "-fluids":
  335.             $list = `listTransforms "-type fluidShape"`;
  336.             break;
  337.         default:
  338.             warning( "Node type not known" );
  339.             break;
  340.     }
  341.  
  342.     // Do the actual hide/show, based on the
  343.     // list that was built in the above case
  344.     // statement
  345.     //
  346.     if( $state == "-hide" ) {
  347.         if (size($list) > 0) {
  348.             hideKeepSelection $list;
  349.         }
  350.         else warning ("No objects to hide.");
  351.     }
  352.     else {
  353.         if (size($list) > 0) {
  354.             string $cmd="showHidden -a";
  355.             for ($i in $list) {
  356.                 if (`objExists $i`)
  357.                     $cmd=($cmd + " " + $i);
  358.             }
  359.             evalEcho $cmd;
  360.         }
  361.         else warning ("No objects to show.");
  362.     }
  363. }
  364.  
  365. global proc adjustSmoothness ( string $selection ){
  366.  
  367.     switch ( $selection ){
  368.         case "Rough":
  369.             displaySmoothness -du 0 -dv 0 -pw 4 -ps 1;
  370.             displaySmoothness -su 6 -sv 6 -pw 4 -ps 1;
  371.             break;
  372.         case "Medium":
  373.             displaySmoothness -du 1 -dv 1 -pw 8 -ps 2;
  374.             displaySmoothness -su 3 -sv 3 -pw 8 -ps 2;
  375.             break;
  376.         case "Fine":
  377.             displaySmoothness -du 2 -dv 2 -pw 16 -ps 4;
  378.             displaySmoothness -su 1 -sv 1 -pw 16 -ps 4;
  379.             break;
  380.         default:
  381.             displaySmoothness -du 1 -dv 1 -pw 8 -ps 2;
  382.             displaySmoothness -su 3 -sv 3 -pw 8 -ps 2;
  383.             break;
  384.     }
  385. }
  386.  
  387. global proc setNormalsSize ( float $val ) 
  388. {
  389.     polyOptions -ao -dn true -sn $val;
  390.         }
  391.  
  392. global proc doFastInteractionItem(int $isFast) 
  393. {
  394.     global int $gFastInteraction;
  395.  
  396.     displayLevelOfDetail -lod $isFast;
  397.     $gFastInteraction = $isFast;
  398.  
  399.     if( `menuItem -exists dispLODItem` ) {
  400.         menuItem -e -cb $isFast dispLODItem;
  401.     }
  402. }
  403.  
  404. global proc toggleSurfaceBackfaceCulling() 
  405. //
  406. //  Toggle the backface culling on all selected surfaces
  407. //
  408. {
  409.     global int $gSelectMeshesBit ;
  410.     global int $gSelectNurbsSurfacesBit;
  411.  
  412.     // Toggle backface culling for all nurbs surfaces
  413.     //
  414.     string $nurbsSurfaces[] = `filterExpand -ex true -sm $gSelectNurbsSurfacesBit`;
  415.     for ( $surface in $nurbsSurfaces ) {
  416.         displayCull -bfc (!`displayCull -q -bfc $surface`) $surface;
  417.     }
  418.  
  419.     //  Toggle backface culling for all mesh surfaces
  420.     //
  421.     string $meshSurfaces[] = `filterExpand -ex true -sm $gSelectMeshesBit`;
  422.     int    $isNotCulled[]  = `polyOptions -q -bc $meshSurfaces`;
  423.     int    $index = 0;
  424.     for ( $surface in $meshSurfaces ) {
  425.         if ( $isNotCulled[$index] ) {
  426.             polyOptions -fb $surface;
  427.         } else {
  428.             polyOptions -bc $surface;
  429.         }
  430.         $index++;
  431.     }
  432. }
  433.  
  434. global proc boundingBoxDisplayCtrl ( int $enabled, string $startNode )
  435. //
  436. // For all the shapes under the selected objects, either turn
  437. // bounding box display on or off based on the value of enabled.
  438. // 0=turn off display, non-zero=turn on display.
  439. //
  440. {
  441.     string $selectedObjects[];
  442.     string $object;
  443.  
  444.     if ( $startNode == "" ) {
  445.         $selectedObjects = `ls -sl`;
  446.     } else {
  447.         $selectedObjects[0] = $startNode;
  448.     }
  449.  
  450.     for ( $object in $selectedObjects ) {
  451.  
  452.         string $shapes[] = `listRelatives -shapes $object`;
  453.         string $shape;
  454.  
  455.         if ( size( $shapes ) == 0 ) {
  456.             string $transform;
  457.             $shapes = `listRelatives -children $object`;
  458.  
  459.             for ( $transform in $shapes ) {
  460.                 if ( `nodeType $transform` == "transform" ) {
  461.                     // We encountered a group node.  Recur down until
  462.                     // we find the shape nodes in this group.
  463.                     boundingBoxDisplayCtrl $enabled $transform;
  464.                 }
  465.             }
  466.         }
  467.  
  468.         for ( $shape in $shapes ) {
  469.             if ( $enabled ) {
  470.                 setAttr ( $shape + ".overrideEnabled") 1;
  471.                 setAttr ( $shape + ".overrideLevelOfDetail") 1;
  472.             } else {
  473.                 // Don't reset the overrideEnabled attribute. It
  474.                 // is used for more than just bounding box display
  475.                 // and turning if off will mess things up of you
  476.                 // have temporarily enabled bounding box display 
  477.                 // of an object in a layer.
  478.                 setAttr ( $shape + ".overrideLevelOfDetail" ) 0;
  479.             }
  480.  
  481.         }
  482.     }
  483. }
  484.  
  485. global proc buildDisplayMenu ( string $parent ) {
  486. //
  487. //    Build the Display menu.  Checks to see if it's already
  488. //    been built, and returns if this is true.
  489. //
  490.  
  491.     setParent -m $parent;
  492.  
  493.     //HeadsUpDisplay Menu Item
  494.     global string $gHeadsUpDisplayMenu;
  495.     
  496.     global int $gToggleOriginAxis;
  497.  
  498.     global int $gShowGrid;
  499.     global float $gJointDisplayScale;
  500.  
  501.     setParent -m $parent;
  502.     if( `menu -q -ni $parent` == 0 ) {
  503.  
  504.         // first Items that affect a whole panel's state
  505.  
  506.         menuItem -cb $gShowGrid 
  507.             -l "Grid"
  508.             -annotation "Grid: Toggle the Grid visibility" 
  509.             -c "ToggleGrid" 
  510.             dispGridItem;
  511.  
  512.         menuItem -ecr false -optionBox 1 
  513.             -annotation "Grid Option Box"
  514.             -l "Grid Option Box"
  515.             -c "GridOptions" dispGridSpacingItem;
  516.  
  517.         //Note: HeadsUpDisplay Toggle methods (except origin axis) are located in initHUDScripts.mel
  518.         //
  519.         if (!`exists initHUDScripts`)
  520.         {
  521.             source initHUDScripts.mel;
  522.         }
  523.  
  524.      $gHeadsUpDisplayMenu = `menuItem -l "Heads Up Display" 
  525.                             -sm true 
  526.                             -tearOff true`;
  527.  
  528.             menuItem -checkBox `optionVar -query objectDetailsVisibility`
  529.                 -label "Object Details"
  530.                 -command "ToggleObjectDetails"
  531.                 -annotation "Object Details: Toggle the display of object details"
  532.                 objectDetailsItem;
  533.  
  534.             menuItem -checkBox `optionVar -query polyCountVisibility`
  535.                 -l "Poly Count"
  536.                 -command "TogglePolyCount"
  537.                 -annotation "Poly Count: Toggle the display of the component count for visible polygons"
  538.                 polyCountItem;
  539.  
  540.             menuItem -checkBox `optionVar -query animationDetailsVisibility`
  541.                 -label "Animation Details"
  542.                 -command "ToggleAnimationDetails"
  543.                 -annotation "Animation Details: Toggle the display of animation details"
  544.                 animationDetailsItem;
  545.  
  546.             menuItem -checkBox `optionVar -query frameRateVisibility`
  547.                 -label "Frame Rate"
  548.                 -command "ToggleFrameRate"
  549.                 -annotation "Frame Rate: Toggle the display of the frame rate"
  550.                 frameRateItem;
  551.  
  552.             menuItem -checkBox `optionVar -query cameraNamesVisibility`
  553.                 -label "Camera Names"
  554.                 -command "ToggleCameraNames"
  555.                 -annotation "Camera Names: Toggle the display of the camera names"
  556.                 cameraNamesItem;
  557.  
  558.             menuItem -checkBox `optionVar -query viewAxisVisibility`
  559.                 -label "View Axis"
  560.                 -command "ToggleViewAxis"
  561.                 -annotation "View Axis: Toggle the visibility of the view axis"
  562.                 viewAxisItem;
  563.  
  564.             menuItem -checkBox $gToggleOriginAxis 
  565.                 -label "Origin Axis" 
  566.                 -annotation "Origin Axis: Toggle the visibility of the origin axis"
  567.                 -command "ToggleOriginAxis" 
  568.                 originAxesItem;
  569.  
  570.         // NOTE:
  571.         // Do not just add new things to the bottom of this menu.
  572.         // Look at the loose groupings above and add new things
  573.         // where they fit best. (modeling, animation, view...)
  574.  
  575.         setParent -menu ..;
  576.  
  577.         global string $gMainOptionsMenu;
  578.         menuItem -l "UI Elements" 
  579.             -subMenu true -tearOff true
  580.             -familyImage "menuIconOptions.xpm"
  581.             -pmc ( "buildPreferenceMenu " + $gMainOptionsMenu )
  582.             $gMainOptionsMenu;
  583.         setParent -m $parent;
  584.  
  585.         menuItem -divider true;
  586.  
  587. // items that work on object's display in all panels
  588.     
  589.         $menuItem = `menuItem -l "Hide" -subMenu 1 -tearOff 1`;
  590.         global string $gDisplayHideSubmenu;
  591.         $gDisplayHideSubmenu = $menuItem;
  592.         menuItem -e -pmc ( "buildHideSubmenu " + $menuItem ) $menuItem;
  593.         setParent -m ..;
  594.     
  595.         $menuItem = `menuItem -l "Show" -subMenu 1 -tearOff 1`;
  596.         global string $gDisplayShowSubmenu;
  597.         $gDisplayShowSubmenu = $menuItem;
  598.         menuItem -e -pmc ( "buildShowSubmenu " + $menuItem ) $menuItem;
  599.         setParent -m ..;
  600.  
  601.         menuItem -d true;
  602.  
  603.         menuItem -l "Wireframe Color..."
  604.                -annotation "Wireframe Color: Set the wireframe color of all selected objects"
  605.                -c "objectColorPalette ()"
  606.                objectColorItem;
  607.  
  608.         menuItem -l "Object Display" -subMenu true -tearOff true;
  609.  
  610.             menuItem -l "Template"
  611.                 -annotation "Template: Make objects templated"
  612.                 -c "TemplateObject" templateOnItem;
  613.  
  614.             menuItem -l "Untemplate"
  615.                 -annotation "Untemplate: Make objects untemplated"
  616.                 -c "UntemplateObject" templateOffItem;
  617.  
  618.             menuItem -d true;
  619.  
  620.             menuItem -l "Bounding Box"
  621.                 -annotation "Bounding Box: Display objects as a box"
  622.                 -c "ShowBoundingBox" enableBoundingBoxDisplayItem;
  623.  
  624.             menuItem -l "No Bounding Box"
  625.                 -annotation "No Bounding Box: Full display of objects"
  626.                 -c "HideBoundingBox" disableBoundingBoxDisplayItem;
  627.  
  628.             menuItem -d true;
  629.  
  630.             menuItem -l "Geometry"       
  631.                 -annotation "Geometry: Display object geometry"
  632.                 -c "ShowObjectGeometry";
  633.  
  634.             menuItem -l "No Geometry"       
  635.                 -annotation "No Geometry: Do not display object geometry"
  636.                 -c "HideObjectGeometry";
  637.  
  638.         setParent -m ..;
  639.  
  640.         menuItem -l "Component Display" -subMenu true -tearOff true objectsCompItem;
  641.         menuItem -l "Backfaces"       
  642.             -annotation "Backfaces: Toggle Geometry Backface visibility"
  643.             -c "ToggleBackfaceGeometry" toggleBackfaceCullingItem;
  644.         menuItem -l "Lattice Points" 
  645.             -annotation "Lattice Points: Toggle Lattice Point visibility"
  646.             -c "ToggleLatticePoints" toggleLatticePtItem;
  647.         menuItem -l "Lattice Shape"  
  648.             -annotation "Lattice Shape: Toggle Lattice Shape visibility"
  649.             -c "ToggleLatticeShape" toggleLatticeShapeItem;
  650.         menuItem -d true;
  651.         menuItem -l "Local Rotation Axes" 
  652.             -annotation "Local Rotation Axes: Toggle local rotation axis visibility"
  653.             -c "ToggleLocalRotationAxes" toggleAxisItem;
  654.         menuItem -l "Rotate Pivots"  
  655.             -annotation "Rotate Pivots: Toggle Rotation Pivot visibility"
  656.             -c "ToggleRotationPivots" toggleRPItem;
  657.         menuItem -l "Scale Pivots"   
  658.             -annotation "Scale Pivots: Toggle Scale Pivot visibility"
  659.             -c "ToggleScalePivots" toggleSPItem;
  660.         menuItem -l "Selection Handles" 
  661.             -annotation "Selection Handles: Toggle Selection Handle visibility"
  662.             -c "ToggleSelectionHandles" toggleSHItem;
  663.         setParent -m ..;
  664.  
  665.         menuItem -d true;
  666.     
  667. // NURBS display items
  668.  
  669.         menuItem -l "NURBS Components" -subMenu true  -aob true -tearOff true curvCompItem;
  670.         menuItem -l "CVs"             
  671.             -annotation "CVs: Toggle CV visibility"
  672.             -c "ToggleCVs" toggleCVItem;
  673.         menuItem -l "Edit Points"     
  674.             -annotation "Edit Points: Toggle Edit Point visibility"
  675.             -c "ToggleEditPoints" toggleEPItem;
  676.         menuItem -l "Hulls"    
  677.             -annotation "Hulls: Toggle Hull visibility"
  678.             -c "ToggleHulls"  toggleHullItem;
  679.         if( `isTrue SurfaceUIExists` ) {
  680.             menuItem -l "Normals (Shaded Mode)"    
  681.                 -imageOverlayLabel "Nrm"
  682.                 -annotation "Normals: Toggle visible normals in shaded mode"
  683.                 -c "ToggleNormals"  toggleNormalItem;
  684.         }
  685.         menuItem -l "Patch Centers"             
  686.             -annotation "Patch Centers: Toggle face center visibility"
  687.             -c "ToggleSurfaceFaceCenters" toggleSurfaceFaceItem;
  688.         menuItem -l "Surface Origins"             
  689.             -annotation "Surface Origins: Toggle origin visibility"
  690.             -c "ToggleSurfaceOrigin" toggleOriginItem;
  691.         menuItem -l "Custom" 
  692.             -annotation ("Custom: Set the visibility options of " +
  693.                          "NURBS components for selected object(s)")
  694.             -dmc "performDisplayControl 2"
  695.             -c "ToggleCustomNURBSComponents" dispSmthnessCustomItem;
  696.         menuItem -ecr false -optionBox true 
  697.             -annotation "Custom NURBS Component Display Option Box"
  698.             -l "Custom Option Box"
  699.             -c "CustomNURBSComponentsOptions" dispSmthnessCustomOBItem;
  700.         setParent -m ..;
  701.         $menuItem = `menuItem -l "NURBS Smoothness" -sm true -to true -aob true`; 
  702.         menuItem -e -pmc ( "buildSmoothnessSubmenu " + $menuItem ) $menuItem;
  703.         setParent -m ..;
  704.  
  705.         menuItem  -divider true;
  706.     
  707.         if (`isTrue "PolygonsExists"`) { 
  708. // Polygons display items
  709.             menuItem -l "Polygon Components" -subMenu true -tearOff true polyComponentsItem;
  710.                 menuItem -l "Vertices"     
  711.                     -annotation "Vertices: Toggle the Poly Vertex visibility"
  712.                     -c "ToggleVertices" togglePolyvItem;
  713.                 menuItem -l "Border Edges" 
  714.                     -annotation "Border Edges: Toggle the Poly Border visibility"
  715.                     -c "ToggleBorderEdges" togglePolyBEItem;
  716.                 menuItem -l "Soft/All Edges"
  717.                     -annotation "Soft Edges: Toggle the Soft Edge visibility"
  718.                     -c "ToggleSoftEdges"
  719.                     togglePolyBE2Item;
  720.                 menuItem -l "Face Centers"
  721.                     -annotation "Face Centers: Toggle the Face Center visibility"
  722.                     -c "TogglePolygonFaceCenters";
  723.                 menuItem -l "UVs"
  724.                     -annotation "UVs: Toggle the UV visibility"
  725.                     -c "ToggleUVs" ;
  726.  
  727.                 menuItem -d true;
  728.     
  729.                 menuItem -l "Normals"    
  730.                     -annotation "Normals: Toggle the Face Normal visibility"
  731.                     -c "ToggleFaceNormals" toggleNormal1Item;
  732.                 menuItem -l "Long Normals"    
  733.                     -annotation "Long Normals: Set the Poly Normal size to Long"
  734.                     -c "LongPolygonNormals" toggleNormal2Item;
  735.                 menuItem -l "Medium Normals" 
  736.                     -annotation "Medium Normals: Set the Poly Normal size to Medium"
  737.                     -c "MediumPolygonNormals" toggleNormal3Item;
  738.                 menuItem -l "Short Normals"    
  739.                     -annotation "Short Normals: Set the Poly Normal size to Short"
  740.                     -c "ShortPolygonNormals" toggleNormal4Item;
  741.         
  742.                 setParent -m ..;
  743.         
  744.             menuItem -l "Custom Polygon Display" 
  745.                 -annotation "Custom Polygon Display: Customize the Polygon Display Options"
  746.                 -dmc "polysDisplaySetup 2"
  747.                 -c "CustomPolygonDisplay" dispPolyCustomItem;
  748.             menuItem -ecr false -optionBox true 
  749.                 -annotation "Custom Polygon Display Option Box"
  750.                 -l "Custom Polygon Display Option Box"
  751.                 -c "CustomPolygonDisplayOptions" dispPolyCustomOBItem;
  752.             menuItem -divider true;
  753.         }
  754.  
  755.         if (`isTrue "SubdivUIExists"`) {
  756.           // Subdiv Surf display items
  757.           menuItem -l "Subdiv Surface Components" -subMenu true  -tearOff true ;
  758.           menuItem -l "Vertices"             
  759.             -annotation "Vertices: Toggle visibility of vertices"
  760.             -c "ToggleMeshPoints" subdivToggleMeshPointItem;
  761.           menuItem -l "Edges"             
  762.             -annotation "Edges: Toggle visibility of edges"
  763.             -c "ToggleMeshEdges" subdivToggleMeshEdgeItem;
  764.           menuItem -l "Faces"             
  765.             -annotation "Faces: Toggle visibility of faces"
  766.             -c "ToggleMeshFaces" subdivToggleMeshFaceItem;
  767.           menuItem -l "UVs"             
  768.             -annotation "Maps: Toggle visibility of UV map components"
  769.             -c "ToggleMeshMaps" subdivToggleMeshMapItem;
  770.  
  771.           menuItem -l "Normals (Shaded Mode)"    
  772.             -imageOverlayLabel "Nrm"
  773.             -annotation "Normals: Toggle visible normals in shaded mode"
  774.             -c "ToggleNormals"  toggleNormalSubdivItem;
  775.  
  776.           menuItem -l "UV Borders (Texture Editor)"             
  777.             -annotation "UV Borders: Toggle visibility of UV texture borders"
  778.             -c "ToggleMeshUVBorders" subdivToggleMeshCreasesItem;
  779.  
  780.           setParent -m ..;
  781.  
  782.           menuItem -l "Subdiv Surface Smoothness" -subMenu true  -tearOff true -aob true ;
  783.         menuItem -l "Hull" 
  784.             -annotation "Display Hull: Set the Display Smoothness to Hull"
  785.             -dmc "performSubdivDisplaySmoothnessHull 2" 
  786.             -c "SubdivSmoothnessHull" 
  787.             dispSmthnessHullItem;
  788.         menuItem -ecr false -optionBox true 
  789.             -annotation "Display Subdiv Hull Option Box"
  790.             -l "Subdiv Hull Option Box"
  791.             -c "SubdivSmoothnessHullOptions" 
  792.             subdivSetHullOptionItem;
  793.           menuItem -l "Rough"             
  794.             -annotation "Rough:  Set the Display Smoothness to Rough"
  795.               -dmc "performSubdivDisplaySmoothnessRough 2" 
  796.               -c "SubdivSmoothnessRough" 
  797.             subdivSetRoughItem;
  798.         menuItem -ecr false -optionBox true 
  799.             -annotation "Display Subdiv Rough Option Box"
  800.             -l "Subdiv Rough Option Box"
  801.             -c "SubdivSmoothnessRoughOptions" 
  802.             subdivSetRoughOptionItem;
  803.  
  804.           menuItem -l "Medium"             
  805.             -annotation "Medium:  Set the Display Smoothness to Medium"
  806.               -dmc "performSubdivDisplaySmoothnessMedium 2" 
  807.               -c "SubdivSmoothnessMedium" 
  808.             subdivSetMediumItem;
  809.         menuItem -ecr false -optionBox true 
  810.             -annotation "Display Subdiv Medium Option Box"
  811.             -l "Subdiv Medium Option Box"
  812.             -c "SubdivSmoothnessMediumOptions" 
  813.             subdivSetMediumOptionItem;
  814.  
  815.           menuItem -l "Fine"             
  816.             -annotation "Fine:  Set the Display Smoothness to Fine"
  817.               -dmc "performSubdivDisplaySmoothnessFine 2" 
  818.               -c "SubdivSmoothnessFine" 
  819.             subdivSetFineItem;
  820.         menuItem -ecr false -optionBox true 
  821.             -annotation "Display Subdiv Fine Option Box"
  822.             -l "Subdiv Fine Option Box"
  823.             -c "SubdivSmoothnessFineOptions" 
  824.             subdivSetFineOptionItem;
  825.  
  826.           setParent -m ..;
  827.           menuItem -d true;
  828.         }
  829.  
  830. // misc. item
  831.         menuItem -cb `optionVar -q "fastInteraction"` -l "Fast Interaction" 
  832.             -annotation "Fast Interaction: Toggle Fast Interaction Mode"
  833.             -c "doFastInteractionItem (!`displayLevelOfDetail -q -lod`)" dispLODItem;
  834.  
  835.         // This menu cannot be tear-off-able since it is dynamically built
  836.         string $menu = `menuItem -l "Camera/Light Manipulator" -sm true`;
  837.         menuItem -e -pmc ("buildRenderManipMenu "+ $menu) $menu;
  838.         setParent -m ..;
  839.         
  840.  
  841.         if (`exists jointDisplayScale`)
  842.         {
  843.             $menuItem = `menuItem -l "Joint Size" -subMenu true -tearOff true`;
  844.             menuItem -e -pmc ( "buildJointScaleSubmenu " + $menuItem ) $menuItem;
  845.             setParent -m ..;
  846.     
  847.             $menuItem = `menuItem -l "IK/FK Joint Size" -subMenu true -tearOff true`;
  848.             menuItem -e -pmc ( "buildIkFkJointScaleSubmenu " + $menuItem ) $menuItem;
  849.             setParent -m ..;
  850.         }
  851.  
  852.         if (`exists ikHandleDisplayScale`)
  853.         {
  854.             $menuItem = `menuItem -l "IK Handle Size" -subMenu true -tearOff true`;
  855.             menuItem -e -pmc ( "buildikHandleScaleSubmenu " + $menuItem ) $menuItem;
  856.             setParent -m ..;
  857.         }
  858.  
  859.  
  860.         if (`isTrue "MayaCreatorExists"` && (`licenseCheck -m "edit" -typ "particlePaint"`))
  861.         {
  862.             menuItem -d 1;
  863.             $menuItem = `menuItem -l "Stroke Display Quality"     
  864.                             -subMenu true -tearOff true`;
  865.             menuItem -e -pmc ( "buildStrokeDisplayQualitySubmenu " 
  866.                             + $menuItem ) $menuItem;
  867.             setParent -m ..;
  868.         }
  869.  
  870.         originAxesMenuUpdate;
  871.         gridMenuUpdate;
  872.     } else {
  873.         //
  874.         //  Update check items
  875.         //
  876.         menuItem -e -cb `displayLevelOfDetail -q -lod` dispLODItem;
  877.     }
  878. }
  879.  
  880. ////////////////////////////////////////////////////////
  881. //
  882. //    The following procedures build the contents of
  883. //    the Display menu submenus - this speeds up the
  884. //    initial display of the Display menu when the user
  885. //    clicks on the menu
  886. //
  887. ////////////////////////////////////////////////////////
  888.  
  889. global proc buildJointScaleSubmenu( string $parent )
  890. //
  891. //    Build the Joint Scale submenu contents
  892. {
  893.     setParent -m $parent;                
  894.         menuItem -l "25%" 
  895.             -annotation "Joint Scale: Set the Joint Scale to 25%"
  896.             -c ("jointDisplayScale .25;"+
  897.                 "$gJointDisplayScale = 0.25;"+
  898.                 "optionVar -fv ikJointDisplayScale 0.25")
  899.             jdsItem1;
  900.         menuItem -l "50%" 
  901.             -annotation "Joint Scale: Set the Joint Scale to 50%"
  902.             -c ("jointDisplayScale .5;"+
  903.                 "$gJointDisplayScale = 0.5;"+
  904.                 "optionVar -fv ikJointDisplayScale 0.5")
  905.             jdsItem2;
  906.         menuItem -l "75%" 
  907.             -annotation "Joint Scale: Set the Joint Scale to 75%"
  908.             -c ("jointDisplayScale .75;"+
  909.                 "$gJointDisplayScale = 0.75;"+
  910.                 "optionVar -fv ikJointDisplayScale 0.75")
  911.             jdsItem3;
  912.         menuItem -l "100%" 
  913.             -annotation "Joint Scale: Set the Joint Scale to 100%"
  914.             -c ("jointDisplayScale 1.0;"+
  915.                 "$gJointDisplayScale = 1.0;"+
  916.                 "optionVar -fv ikJointDisplayScale 1.0")
  917.             jdsItem4; 
  918.         menuItem -l "Custom..."
  919.             -annotation "Joint Scale: Customize the Joint Scale" 
  920.             -c "jdsWin" jdsItem5;
  921.  
  922.     // Delete the -pmc now that the submenu contents are built
  923.     //
  924.     menuItem -e -pmc "" $parent;
  925. }
  926.  
  927. global proc buildIkFkJointScaleSubmenu( string $parent )
  928. //
  929. //    Build the Joint Scale submenu contents
  930. {
  931.     setParent -m $parent;                
  932.         menuItem -l "25%" 
  933.             -annotation "IK/FK Joint Scale: Set the IK/FK Joint Scale to 25%"
  934.             -c ("jointDisplayScale -ikfk .25;"+
  935.                 "$gIkFkJointDisplayScale = 0.25;"+
  936.                 "optionVar -fv ikIkFkJointDisplayScale 0.25")
  937.             ikfkjdsItem1;
  938.         menuItem -l "50%" 
  939.             -annotation "IK/FK Joint Scale: Set the IK/FK Joint Scale to 50%"
  940.             -c ("jointDisplayScale -ikfk .5;"+
  941.                 "$gIkFkJointDisplayScale = 0.5;"+
  942.                 "optionVar -fv ikIkFkJointDisplayScale 0.5")
  943.             ikfkjdsItem2;
  944.         menuItem -l "75%" 
  945.             -annotation "IK/FK Joint Scale: Set the IK/FK Joint Scale to 75%"
  946.             -c ("jointDisplayScale -ikfk .75;"+
  947.                 "$gIkFkJointDisplayScale = 0.75;"+
  948.                 "optionVar -fv ikIkFkJointDisplayScale 0.75")
  949.             ikfkjdsItem3;
  950.         menuItem -l "100%" 
  951.             -annotation "IK/FK Joint Scale: Set the IK/FK Joint Scale to 100%"
  952.             -c ("jointDisplayScale -ikfk 1.0;"+
  953.                 "$gIkFkJointDisplayScale = 1.0;"+
  954.                 "optionVar -fv ikIkFkJointDisplayScale 1.0")
  955.             ikfkjdsItem4; 
  956.         menuItem -l "Custom..."
  957.             -annotation "IK/FK Joint Scale: Customize the IK/FK Joint Scale" 
  958.             -c "ikfkjdsWin" ikfkjdsItem5;
  959.  
  960.     // Delete the -pmc now that the submenu contents are built
  961.     //
  962.     menuItem -e -pmc "" $parent;
  963. }
  964.  
  965. global proc buildikHandleScaleSubmenu( string $parent )
  966. //
  967. //    Build the ikHandle Scale submenu contents
  968. {
  969.     setParent -m $parent;                
  970.         menuItem -l "25%" 
  971.             -annotation "IK Handle Scale: Set the IK Handle Scale to 25%"
  972.             -c ("ikHandleDisplayScale .25;"+
  973.                 "$gikHandleDisplayScale = 0.25;"+
  974.                 "optionVar -fv ikHandleDisplayScale 0.25")
  975.             ikHdsItem1;
  976.         menuItem -l "50%" 
  977.             -annotation "IK Handle Scale: Set the IK Handle Scale to 50%"
  978.             -c ("ikHandleDisplayScale .5;"+
  979.                 "$gikHandleDisplayScale = 0.5;"+
  980.                 "optionVar -fv ikHandleDisplayScale 0.5")
  981.             ikHdsItem2;
  982.         menuItem -l "75%" 
  983.             -annotation "IK Handle Scale: Set the IK Handle Scale to 75%"
  984.             -c ("ikHandleDisplayScale .75;"+
  985.                 "$gikHandleDisplayScale = 0.75;"+
  986.                 "optionVar -fv ikHandleDisplayScale 0.75")
  987.             ikHdsItem3;
  988.         menuItem -l "100%" 
  989.             -annotation "IK Handle Scale: Set the IK Handle Scale to 100%"
  990.             -c ("ikHandleDisplayScale 1.0;"+
  991.                 "$gikHandleDisplayScale = 1.0;"+
  992.                 "optionVar -fv ikHandleDisplayScale 1.0")
  993.             ikHdsItem4; 
  994.         menuItem -l "Custom..." 
  995.             -annotation "Custom IK Handle Scale: Customize the IK Handle scale"
  996.             -c "ikHdsWin" ikHdsItem5;
  997.  
  998.     // Delete the -pmc now that the submenu contents are built
  999.     //
  1000.     menuItem -e -pmc "" $parent;
  1001. }
  1002.  
  1003. global proc buildHideSubmenu( string $parent )
  1004. //
  1005. //    Build the Hide submenu contents
  1006. {
  1007.     int $dimWhenNoSelect = 0;
  1008.     int $completeLicense = `licenseCheck -m "edit" -typ "complete"`;
  1009.     
  1010.     setParent -m $parent;
  1011.         menuItem -l "Hide Selection" 
  1012.             -annotation "Hide Selection: Hide the selected object(s)"
  1013.             -c "HideSelectedObjects" hideItem;
  1014.         if( $dimWhenNoSelect ) {
  1015.             dimWhen -f "SomethingSelected" ($parent+"|hideItem");
  1016.         }
  1017.  
  1018.         menuItem -l "Hide Unselected Objects" 
  1019.             -annotation 
  1020.             "Hide Unselected Objects: Hide all objects that are not selected"
  1021.             -c "HideUnselectedObjects" hideUnselectedItem;
  1022.         if( $dimWhenNoSelect ) {
  1023.             dimWhen -f "SomethingSelected" ($parent+"|hideUnselectedItem");
  1024.         }
  1025.  
  1026.         menuItem -l "Hide Unselected CVs" 
  1027.             -annotation 
  1028.             "Hide Unselected CVs: Hide all CVs on the surface that are not selected"
  1029.             -c "HideUnselectedCVs" hideUnselectedCVsItem;
  1030.         if( $dimWhenNoSelect ) {
  1031.             dimWhen -f "SomethingSelected" ($parent+"|hideUnselectedCVsItem");
  1032.         }
  1033.  
  1034.         menuItem -l "All" 
  1035.             -annotation "Hide All: Hide all objects"
  1036.             -c "HideAll" hideAllItem;
  1037.  
  1038.         menuItem -d true;
  1039.  
  1040.         menuItem -l "Hide Geometry" -sm true -to true;
  1041.             menuItem -l "All" 
  1042.                 -annotation "Hide All Geometry"
  1043.                 -c "HideGeometry" hideGeometryItem;
  1044.             menuItem -d true;
  1045.             if( `isTrue "SurfaceUIExists"` ) {
  1046.                 menuItem -l "NURBS Surfaces" 
  1047.                     -annotation "Hide All NURBS Surfaces"
  1048.                     -c "HideNURBSSurfaces"
  1049.                     hideNurbsSurfacesItem;
  1050.             }
  1051.             menuItem -l "NURBS Curves" 
  1052.                 -annotation "Hide All NURBS Curves"
  1053.                 -c "HideNURBSCurves"
  1054.                 hideNurbsCurvesItem;
  1055.             menuItem -l "Polygon Surfaces" 
  1056.                 -annotation "Hide All Polygon Surfaces"
  1057.                 -c "HidePolygonSurfaces"
  1058.                 hidePolySurfacesItem;
  1059.             menuItem -l "Deforming Geometry"
  1060.                  -annotation "Hide All Deforming Geometry"
  1061.                 -c "HideDeformingGeometry";
  1062.  
  1063.             if (`isTrue "SubdivUIExists"`) {
  1064.               menuItem -l "Subdiv Surfaces"
  1065.                  -annotation "Hide All Subdiv Surfaces"
  1066.                 -c "HideSubdivSurfaces"
  1067.                 subdivToggleHideGeometryItem;
  1068.             }
  1069.             if(`isTrue "MayaCreatorExists"` && (`licenseCheck -m "edit" -typ "particlePaint"`)) {
  1070.                 menuItem -d 1;
  1071.                 menuItem  -l "Strokes" 
  1072.                     -annotation "Hide All Strokes"
  1073.                     -c "HideStrokes" hideStrokesItem;
  1074.                 menuItem  -l "Stroke Path Curves" 
  1075.                     -annotation "Hide All Stroke Path Curves"
  1076.                     -c "HideStrokePathCurves" hideStrokeCurvesItem;
  1077.                 menuItem  -l "Stroke Control Curves" 
  1078.                     -annotation "Hide All Stroke Control Curves"
  1079.                     -c "HideStrokeControlCurves" hideStrokeControlCurvesItem;
  1080.             }
  1081.  
  1082.         setParent -m ..;
  1083.  
  1084.         menuItem -l "Hide Kinematics" -sm true -to true;
  1085.             menuItem -l "All" 
  1086.                 -annotation "Hide All Kinematics"
  1087.                 -c "HideKinematics" hideKinItem;
  1088.             menuItem -d true;
  1089.             menuItem -l "Joints" 
  1090.                 -annotation "Hide All Joints"
  1091.                 -c "HideJoints" hideJointsItem;
  1092.             menuItem -l "IK Handles" 
  1093.                 -annotation "Hide All IK Handles"
  1094.                 -c "HideIKHandles" 
  1095.                 hideHandleItem;
  1096.         setParent -m ..;
  1097.  
  1098.         menuItem -l "Hide Deformers" -sm true -to true hideDeformersItem;
  1099.             menuItem -l "All" 
  1100.                 -annotation "Hide All Deformers"
  1101.                 -c "HideDeformers" hideDeformItem;
  1102.             menuItem -d true;
  1103.             menuItem -l "Lattices" 
  1104.                 -annotation "Hide All Lattices"
  1105.                 -c "HideLattices" hideFFDItem;
  1106.             if ($completeLicense) {            
  1107.                 menuItem -l "Sculpt Objects" 
  1108.                     -annotation "Hide All Sculpt Objects"
  1109.                     -c "HideSculptObjects" hideSculptItem;
  1110.                 menuItem -l "Clusters" 
  1111.                     -annotation "Hide All Clusters"
  1112.                     -c "HideClusters" hideClusterItem;
  1113.             }
  1114.             menuItem -l "Nonlinears"
  1115.                 -annotation "Hide All Nonlinears"
  1116.                 -c "HideNonlinears" hideNonlinearItem;
  1117.  
  1118.             if ($completeLicense) {
  1119.                 menuItem -l "Wrap Influences"
  1120.                     -annotation "Hide All Wrap Influences"
  1121.                     -c "HideWrapInfluences" hideWrapItem;
  1122.             }
  1123.             menuItem -l "Smooth Skin Influences"
  1124.                 -annotation "Hide All Smooth Skin Influences"
  1125.                 -c "HideSmoothSkinInfluences" hideSkinClusterItem;
  1126.  
  1127.         setParent -m ..;
  1128.  
  1129.         // create Hide->Cloth menu only if cloth has been loaded
  1130.         //
  1131.         if (`exists cpSolver`)
  1132.         {
  1133.             global string $gHideClothItem;
  1134.  
  1135.             $gHideClothItem = `menuItem -l "Hide Cloth" -sm true -to true`;
  1136.                 menuItem -l "All" 
  1137.                     -c "HideCloth"
  1138.                     -annotation "Hide All Cloth";
  1139.                 menuItem -d true;
  1140.                 menuItem -l "Panel Curves" 
  1141.                     -c "HideClothPanelCurves"
  1142.                     -annotation "Hide Cloth Panel Curves";
  1143.                 menuItem -l "Panels" 
  1144.                     -c "HideClothPanels"
  1145.                     -annotation "Hide Cloth Panels";
  1146.                 menuItem -l "Seams" 
  1147.                     -c "HideClothSeams"
  1148.                     -annotation "Hide Cloth Seams";
  1149.  
  1150.                 setParent -m ..;
  1151.         }
  1152.             
  1153.  
  1154.         menuItem  -l "Lights" 
  1155.             -annotation "Hide All Lights"
  1156.             -c "HideLights" hideLightsItem;
  1157.         menuItem  -l "Cameras" 
  1158.             -annotation "Hide All Cameras"
  1159.             -c "HideCameras" hideCamerasItem;
  1160.         menuItem  -l "Texture Placements" 
  1161.             -annotation "Hide All Texture Placements"
  1162.             -c "HideTexturePlacements" hidePlace3dTxItem;
  1163.         menuItem  -l "Construction Planes" 
  1164.             -annotation "Hide All Construction Planes"
  1165.             -c "HidePlanes" hidePlanesItem;
  1166.  
  1167.         if( fluidEditLicenseFound() ) {
  1168.             menuItem  -l "Fluids" 
  1169.                 -annotation "Hide All Fluids"
  1170.                 -c "HideFluids" hideFluidsItem;
  1171.         }
  1172.  
  1173.         menuItem -d true;
  1174.  
  1175.         menuItem  -l "Animation Markers" 
  1176.             -annotation "Hide All Animation Markers"
  1177.             -c "HideMarkers" hideMarkersItem;
  1178.  
  1179.         if (`isTrue "RenderingExists"`)    { 
  1180.             menuItem  -l "Light Manipulators" 
  1181.                 -annotation "Hide All Light Manipulators"
  1182.                 -c "HideLightManipulators"    
  1183.                 hideLightManipItem;
  1184.             menuItem  -l "Camera Manipulators" 
  1185.                 -annotation "Hide All Camera Manipulators"
  1186.                 -c "HideCameraManipulators"    
  1187.                 hideCameraManipItem;
  1188.             }
  1189.  
  1190.     // Delete the -pmc now that the contents of the submenu are built
  1191.     //
  1192.     menuItem -e -pmc "" $parent;
  1193. }
  1194.  
  1195. global proc buildShowSubmenu( string $parent )
  1196. //
  1197. //    Build the Show submenu contents
  1198. {
  1199.     int $dimWhenNoSelect = 0;
  1200.     int $completeLicense = `licenseCheck -m "edit" -typ "complete"`;        
  1201.     setParent -m $parent;
  1202.  
  1203.         menuItem -l "Show Selection" 
  1204.             -annotation "Show Selection: Show all selected objects"
  1205.             -c "ShowSelectedObjects" showHiddenItem;
  1206.             if( $dimWhenNoSelect ) {
  1207.             dimWhen -f "SomethingSelected" ($parent+"|showHiddenItem");
  1208.         }
  1209.         menuItem -l "Show Last Hidden" -ecr false
  1210.                 -annotation "Show Last Hidden: Show the last hidden item"
  1211.                 -c "ShowLastHidden" showLastHiddenItem;    
  1212.         menuItem -l "All Surface CVs" -ecr false
  1213.             -annotation "Show All Surface CVs: Show all CVs for the surface with the selected CV(s)"
  1214.                 -c "ShowSurfaceCVs" showAllSurfaceCVsItem;    
  1215.         menuItem -l "All" 
  1216.             -annotation "Show All: Show All Objects"
  1217.             -c "ShowAll" visibilityShowAllItem2;
  1218.  
  1219.         menuItem -d true;
  1220.  
  1221.         menuItem -l "Show Geometry" -sm true -to true;
  1222.             menuItem -l "All" 
  1223.             -annotation "Show All Geometry"
  1224.             -c "ShowAll" showGeometryItem;
  1225.             menuItem -d true;
  1226.             if( `isTrue "SurfaceUIExists"` ) {
  1227.                 menuItem -l "NURBS Surfaces" 
  1228.                     -annotation "Show All NURBS Surfaces"
  1229.                     -c "ShowNURBSSurfaces"
  1230.                     showNurbsSurfacesItem;
  1231.             }
  1232.             menuItem -l "NURBS Curves" 
  1233.                 -annotation "Show All NURBS Curves"
  1234.                 -c "ShowNURBSCurves"
  1235.                 showNurbsCurvesItem;
  1236.             menuItem -l "Polygon Surfaces" 
  1237.                 -annotation "Show All Polygon Surfaces"
  1238.                 -c "ShowPolygonSurfaces"
  1239.                 showPolySurfacesItem;
  1240.             menuItem -l "Deforming Geometry" 
  1241.                 -annotation "Show All Deforming Geometry"
  1242.                 -c "ShowDeformingGeometry";
  1243.  
  1244.             if (`isTrue "SubdivUIExists"`) {
  1245.               menuItem -l "Subdiv Surfaces"
  1246.                  -annotation "Show All Subdiv Surfaces"
  1247.                 -c "ShowSubdivSurfaces"
  1248.                 subdivToggleShowGeometryItem;
  1249.             }
  1250.             if(`isTrue "MayaCreatorExists"` && (`licenseCheck -m "edit" -typ "particlePaint"`)) {
  1251.                 menuItem -d 1;
  1252.                 menuItem  -l "Strokes" 
  1253.                     -annotation "Show All Strokes"
  1254.                     -c "ShowStrokes" showStrokesItem;
  1255.                 menuItem  -l "Stroke Path Curves" 
  1256.                     -annotation "Show All Stroke Path Curves"
  1257.                     -c "ShowStrokePathCurves" showStrokeCurvesItem;
  1258.                 menuItem  -l "Stroke Control Curves" 
  1259.                     -annotation "Show All Stroke Control Curves"
  1260.                     -c "ShowStrokeControlCurves" showStrokeControlCurvesItem;
  1261.             }
  1262.  
  1263.         setParent -m ..;
  1264.  
  1265.         menuItem -l "Show Kinematics" -sm true -to true;
  1266.             menuItem -l "All" 
  1267.                 -annotation "Show All Kinematics"
  1268.                 -c "ShowKinematics" showKinItem;
  1269.             menuItem -d true;
  1270.             menuItem -l "Joints" 
  1271.                 -annotation "Show All Joints"
  1272.                 -c "ShowJoints" showJointsItem;
  1273.             menuItem -l "IK Handles" 
  1274.                 -annotation "Show All IK Handles"
  1275.                 -c "ShowIKHandles" showHandleItem;
  1276.         setParent -m ..;
  1277.  
  1278.         menuItem -l "Show Deformers" -sm true -to true showDeformersItem;
  1279.             menuItem -l "All" 
  1280.                 -annotation "Show All Deformers"
  1281.                 -c "ShowDeformers" showDeformItem;
  1282.             menuItem -d true;
  1283.             menuItem -l "Lattices" 
  1284.                 -annotation "Show All Lattices"
  1285.                 -c "ShowLattices" showFFDItem;
  1286.             if ($completeLicense) {
  1287.                 menuItem -l "Sculpt Objects" 
  1288.                     -annotation "Show All Sculpt Objects"
  1289.                     -c "ShowSculptObjects" showSculptItem;
  1290.                 menuItem -l "Clusters" 
  1291.                     -annotation "Show All Clusters"
  1292.                     -c "ShowClusters" showClusterItem;
  1293.             }
  1294.             menuItem -l "Nonlinears"
  1295.                 -annotation "Show All Nonlinears"
  1296.                 -c "ShowNonlinears" showNonlinearItem;
  1297.             if ($completeLicense) {
  1298.                 menuItem -l "Wrap Influences"
  1299.                     -annotation "Show All Wrap Influences"
  1300.                     -c "ShowWrapInfluences" showWrapItem;
  1301.             }
  1302.             menuItem -l "Smooth Skin Influences"
  1303.                 -annotation "Show All Smooth Skin Influences"
  1304.                 -c "ShowSmoothSkinInfluences" showSkinClusterItem;
  1305.  
  1306.         setParent -m ..;
  1307.         
  1308.         // create Show->Cloth menu only is cloth is loaded
  1309.         //
  1310.         if (`exists cpSolver`)
  1311.         {
  1312.             global string $gShowClothItem;
  1313.  
  1314.             $gShowClothItem = `menuItem -l "Show Cloth" -sm true -to true`;
  1315.                 menuItem -l "All" 
  1316.                     -annotation "Show All Cloth Parts"
  1317.                     -c "ShowCloth";
  1318.                 menuItem -d true;
  1319.                 menuItem -l "Panel Curves" 
  1320.                     -c "ShowClothPanelCurves"
  1321.                     -annotation "Show Cloth Panel Curves";
  1322.                 menuItem -l "Panels" 
  1323.                     -c "ShowClothPanels"
  1324.                     -annotation "Show Cloth Panels";
  1325.                 menuItem -l "Seams" 
  1326.                     -c "ShowClothSeams"
  1327.                     -annotation "Show Cloth Seams";
  1328.                 setParent -m ..;    
  1329.         }
  1330.  
  1331.         menuItem  -l "Lights" 
  1332.             -annotation "Show All Lights"
  1333.             -c "ShowLights" showLightsItem;
  1334.         menuItem  -l "Cameras" 
  1335.             -annotation "Show All Cameras"
  1336.             -c "ShowCameras" showCamerasItem;
  1337.         menuItem  -l "Texture Placements" 
  1338.             -annotation "Show All Texture Placements"
  1339.             -c "ShowTexturePlacements" showPlace3dTxItem;
  1340.         menuItem  -l "Construction Planes" 
  1341.             -annotation "Show All Construction Planes"
  1342.             -c "ShowPlanes" showPlanesItem;
  1343.  
  1344.         if( fluidEditLicenseFound() ) {
  1345.             menuItem  -l "Fluids" 
  1346.                 -annotation "Show All Fluids"
  1347.                 -c "ShowFluids" showFluidsItem;
  1348.         }
  1349.  
  1350.         menuItem -d true;
  1351.  
  1352.         menuItem  -l "Animation Markers" 
  1353.             -annotation "Show All Animation Markers"
  1354.             -c "ShowMarkers" showMarkersItem;
  1355.  
  1356.         if (`isTrue "RenderingExists"`)    { 
  1357.             menuItem  -l "Light Manipulators" 
  1358.                 -annotation "Show All Light Manipulators"
  1359.                 -c "ShowLightManipulators"    
  1360.                 showLightManipItem;
  1361.                 if( $dimWhenNoSelect ) {
  1362.                 dimWhen -f "SomethingSelected" 
  1363.                 ($parent+"|showLightManipItem");
  1364.             }
  1365.             menuItem  -l "Camera Manipulators" 
  1366.                 -annotation "Show All Camera Manipulators"
  1367.                 -c "ShowCameraManipulators"
  1368.                 showCameraManipItem;
  1369.             if( $dimWhenNoSelect ) {
  1370.                 dimWhen -f "SomethingSelected" 
  1371.                     ($parent+"|showCameraManipItem");
  1372.             }
  1373.         }
  1374.  
  1375.     // Delete the -pmc now that the submenu contents are built
  1376.     //
  1377.     menuItem -e -pmc "" $parent;
  1378. }
  1379.  
  1380. global proc buildSmoothnessSubmenu( string $parent )
  1381. //
  1382. //    Build the Smoothness submenu contents
  1383. {
  1384.     setParent -m $parent;
  1385.         menuItem -l "Hull" 
  1386.             -annotation "Display Hull: Set the Display Smoothness to Hull"
  1387.             -dmc "performDisplaySmoothnessHull 2" 
  1388.             -c "NURBSSmoothnessHull" 
  1389.             dispSmthnessHullItem;
  1390.         menuItem -ecr false -optionBox true 
  1391.             -annotation "Display Hull Option Box"
  1392.             -l "Hull Option Box"
  1393.             -c "NURBSSmoothnessHullOptions" 
  1394.             dispSmthnessHullOptionItem;
  1395.  
  1396.         menuItem -l "Rough" 
  1397.             -annotation "Display Rough: Set the Display Smoothness to Rough"
  1398.             -dmc "performDisplaySmoothnessRough 2" 
  1399.             -c "NURBSSmoothnessRough" 
  1400.             dispSmthnessRoughItem;
  1401.         menuItem -ecr false -optionBox true 
  1402.             -annotation "Display Rough Option Box"
  1403.             -l "Rough Option Box"
  1404.             -c "NURBSSmoothnessRoughOptions" 
  1405.             dispSmthnessRoughOptionItem;
  1406.  
  1407.         menuItem -l "Medium" 
  1408.             -annotation "Display Medium: Set the Display Smoothness to Medium"
  1409.             -dmc "performDisplaySmoothnessMedium 2" 
  1410.             -c "NURBSSmoothnessMedium" 
  1411.             dispSmthnessMediumItem;
  1412.         menuItem -ecr false -optionBox true 
  1413.             -annotation "Display Medium Option Box"
  1414.             -l "Medium Option Box"
  1415.             -c "NURBSSmoothnessMediumOptions" 
  1416.             dispSmthnessMediumOptionItem;
  1417.  
  1418.         menuItem -l "Fine" 
  1419.             -annotation "Display Fine: Set the Display Smoothness to Fine"
  1420.             -dmc "performDisplaySmoothnessFine 2" 
  1421.             -c "NURBSSmoothnessFine" 
  1422.             dispSmthnessFineItem;
  1423.         menuItem -ecr false -optionBox true 
  1424.             -annotation "Display Fine Option Box"
  1425.             -l "Fine Option Box"
  1426.             -c "NURBSSmoothnessFineOptions" 
  1427.             dispSmthnessFineOptionItem;
  1428.         menuItem -d true;
  1429.  
  1430.         menuItem -l "Custom" 
  1431.             -annotation "Display Custom: Define and set a customized Display Smoothness"
  1432.             -dmc "performDisplaySmoothnessCustom 2" 
  1433.             -c "CustomNURBSSmoothness" 
  1434.             dispSmthnessCustomItem;
  1435.         menuItem -ecr false -optionBox true 
  1436.             -annotation "Display Custom Option Box"
  1437.             -l "Custom Option Box"
  1438.             -c "CustomNURBSSmoothnessOptions" 
  1439.             dispSmthnessCustomOptionItem;
  1440.     
  1441.     // Delete the -pmc now that the submenu contents are built
  1442.     //
  1443.     menuItem -e -pmc "" $parent;
  1444. }
  1445.